<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>duang一声首页留言</title>
	<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
	<div id="big">
		<div class="big_title">
			<p class="title">duang一声留言板</p>
		</div>
		<div class="list">
			<!-- 搜索表单 -->
			<div class="list_title">
				留言列表
				<form class="bd" action="index.php?a=index">
					<input  class="au" type="submit" value="搜索">
					<input  class="ss" type="text" name="s">
				</form><!-- 搜索 -->
				
			</div>
			<!-- 留言列表 -->
			<?php foreach ($db as $id => $d):?>
			<div class="description">
				<div class="pic">
					<div class="box">
					<!-- 头像 -->
						<img src="<?php echo $d['icon'];?>" alt="">
					</div>
					<!-- 昵称 -->
					<p class="nickname"><?php echo $d['nickname'];?></p>
				</div>
					
				<div class="content">
					<!-- 留言时间 -->
					<div class="subject">
						<span>主题：<?php echo $d['title'];?></span>
						<span>时间：<?php echo $d['time'];?></span>
					</div>
					<!-- 留言内容 -->
					<div class="matter"><?php echo $d['body'];?></div>
					<!-- 删除留言 -->
					<div class="dell"><a href="javascript:;" onclick="confirm('确定删除吗')?location.href='index.php?a=del&id=<?php echo $id;?>':''">删除</a></div>

				</div>
			</div>

			<?php endforeach;?>
			<!-- 留言条数 -->
			<div class="bottom">共<?php echo count($db);?>条记录</div>
		</div>
		
		<!-- 留言表单 -->
		<form action="?a=post" method="post">
			<div class="biaodan">
				<p class="publish">发表留言</p>
				<!-- 标题 -->
				<div class="headline">
					<p>标题</p>
					<input name="title" type="text">
				</div>
				<!-- 昵称 -->
				<div class="headline">
					<p>昵称</p>
					<input name="nickname" type="text">
				</div>
				<div class="portrait">
				<!-- 头像选择 -->
					<p>头像</p>
					<div class="face">
						<!-- 遍历图片和按钮添加图片 -->
						<?php foreach ($icons as $icon):?>
						<label>
							<input type="radio" name="icon" value="<?php echo $icon;?>" checked="">
							<img src="<?php echo $icon;?>" alt="">
						</label>
						<?php endforeach;?>
					</div>
				</div>
				<!-- 留言内容 -->
				<div class="details">
					<p>留言内容</p>
					<textarea name="body" cols="40" rows="6"></textarea>
				</div>
				<!-- 发布留言 -->
				<div class="sub">
					<input type="submit" class="button" value="发布留言">
					<input type="reset" value="重填">
				</div>
			</div>
		</form>




	</div>
</body>
</html>